<?php

use Illuminate\Routing\Router;

Admin::routes();

Route::group([
    'prefix'        => config('admin.route.prefix'),
    'namespace'     => config('admin.route.namespace'),
    'middleware'    => config('admin.route.middleware'),
    'as'            => config('admin.route.prefix') . '.',
], function (Router $router) {

    $router->get('/', 'HomeController@index')->name('home');

    $router->resource('users', UserController::class);
    $router->resource('common-adsenses', Common\AdsenseController::class);
    $router->resource('common-adsenses-medias', Common\AdsenseMediaController::class);

    $router->resource('common-app-agreements', Common\AppAgreementController::class);
    $router->resource('common-app-versions', Common\AppVersionController::class);
    $router->resource('common-banks', Common\BankController::class);
    $router->resource('common-configs', Common\ConfigController::class);


    $router->resource('common-financial-flows', Common\FinancialFlowController::class);

    $router->resource('common-regions', Common\RegionController::class);

    $router->resource('common-user-tags', Common\UserTagController::class);

    $router->resource('security-cars', Security\CarController::class);

    $router->resource('security-users', Security\UserController::class);

    $router->resource('services', Service\IndexController::class);

    $router->resource('service-categories', Service\CategoryController::class);

    $router->resource('service-comments', Service\CommentController::class);

    $router->resource('service-medias', Service\MediaController::class);

    $router->resource('service-orders', Service\OrderController::class);

    $router->resource('service-snapshots', Service\SnapshotController::class);

    $router->resource('user-banks', User\BankController::class);

    //$router->resource('user-medias', User\MediaController::class);

    $router->resource('user-recharges', User\RechargeController::class);

    $router->resource('user-securities', User\SecurityController::class);

    $router->resource('user-tags', User\TagController::class);

    $router->resource('user-withdrawals', User\WithdrawalController::class);



    // extend
    $router->get('/ajax/region', '\App\Admin\Controllers\Common\RegionController@load');
    $router->get('/ajax/secureCar', '\App\Admin\Controllers\Security\CarController@load');
    $router->get('/ajax/user', '\App\Admin\Controllers\UserController@load');
    $router->get('/ajax/common-tag', '\App\Admin\Controllers\ApiController@commonTag');
    $router->get('/ajax/security-user', '\App\Admin\Controllers\ApiController@securityUser');
    $router->get('/ajax/banklist', '\App\Admin\Controllers\ApiController@banklist');
    $router->get('/ajax/service-category', '\App\Admin\Controllers\ApiController@serviceCategory');
    $router->get('/ajax/service-list','\App\Admin\Controllers\ApiController@serviceList');
    $router->get('/ajax/userlist', '\App\Admin\Controllers\ApiController@user');

});
